package com.qf.service.impl;

import com.qf.dao.ClassifyListRepository;
import com.qf.dao.StoreInfoRepository;
import com.qf.pojo.entity.ClassifyList;
import com.qf.pojo.entity.StoreInfo;
import com.qf.pojo.resp.BaseResp;
import com.qf.pojo.resp.IndexResp;
import com.qf.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName IndexServiceImpl
 * @Description TODO
 * @Author Windy
 * @Date 2022/9/28 17:17
 * @Version 1.0
 **/
@Service
public class IndexServiceImpl implements IndexService {

    @Autowired
    ClassifyListRepository classifyListRepository;

    @Autowired
    StoreInfoRepository storeInfoRepository;

    @Override
    public BaseResp getList() {
        IndexResp indexResp = new IndexResp();

        List<ClassifyList> classifyLists = classifyListRepository.findAll();
        List<StoreInfo> storeInfos = storeInfoRepository.findAll();
        indexResp.setClassifyList(classifyLists);
        indexResp.setStoreInfoList(storeInfos);

        return new BaseResp(200,"查询成功",indexResp);
    }
}
